import React from 'react';
import { Link } from 'react-router';

export default class Content extends React.Component{
    constructor(props){
        super(props);
        this.state = {
            title:this.props.title || '控制台'
        }
    }
    componentWillReceiveProps(nextProp){
        this.setState({
            title:nextProp.title
        })
    }
    render(){
        return(
            <div>
                <h2 style={{
                    color:'#999',
                    fontSize:'22px',
                    fontWeight:'normal',
                    padding:'10px',
                    borderBottom:'1px solid #eee',
                    backgroundColor:'#e4eaec'
                    }}
                    id="boardTitle"
                >{this.state.title}</h2>
                <div id="contenter">
                    {this.props.children}
                </div>
            </div>
        )
    }
}